//
//  JinTabBarViewController.swift
//  lottery
//
//  Created by admin on 16/2/3.
//  Copyright © 2016年 jin. All rights reserved.
//

import UIKit

class JinTabBarViewController: UITabBarController,JinTabBarItemDelegate {
    // 当前tabBarItem
    let tabBarView:JinTabBarItem! = JinTabBarItem(frame: CGRectMake(0, UIScreen.mainScreen().bounds.size.height - 49, UIScreen.mainScreen().bounds.size.width, 49))
    override func viewDidLoad() {
        super.viewDidLoad()
        // 设置tabBarItem代理
        tabBarView.tabBarButtonDelegate = self
//        tabBarView.backgroundColor = UIColor.grayColor()
        // 添加按钮
        for(var i = 1;i <= 5;i++)
        {
            tabBarView.addTabBarButton("TabBar\(i)",selectedImage: "TabBar\(i)Sel")
        }
        // 添加进当前view
        self.view.addSubview(tabBarView)
    }
    func tabBarButtonClicked(index: Int) {
        self.selectedIndex = index
    }
}
